package com.KKd.service;

import com.KKd.mapper.CatalogueMapper;
import com.KKd.pojo.Catalogue;
import com.alibaba.druid.sql.visitor.functions.Lcase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author 14587
 * @date 2020/11/11 7:52
 */
@Service
public class CatalogueServiceImpl implements CatalogueService{
    @Autowired
    private CatalogueMapper catalogueMapper;
    //所有的这里没有set也可以，因为使用注解开发时使用了反射，如果不用注解的话，就需要手动加载在bean中

    public void setCatalogueMapper(CatalogueMapper catalogueMapper) {
        this.catalogueMapper = catalogueMapper;
    }

    public int insertCatalogue(Catalogue catalogue) {
        return catalogueMapper.insertCatalogue(catalogue);
    }

    public int deleteCatalogue(Integer catalogueId) {
        return catalogueMapper.deleteCatalogue(catalogueId);
    }

    public String getCataNameByCataId(Integer catalogueId) {
        return catalogueMapper.getCataNameByCataId(catalogueId);
    }

    public int insertCatalogueById(Catalogue catalogue) {
        return catalogueMapper.insertCatalogueById(catalogue);
    }

    public int deleteCatalogueById(Integer blogId) {
        return catalogueMapper.deleteCatalogueById(blogId);
    }

    public List<Catalogue> showCatalogue() {
        return catalogueMapper.showCatalogue();
    }

    public List<String> showBlogTitleByCata(Integer catalogueId) {
        return catalogueMapper.showBlogTitleByCata(catalogueId);
    }

    public Integer getBiggestCataId() {
        return catalogueMapper.getBiggestCataId();
    }
}
